
#define MAP_WIDTH	15
#define MAP_HEIGHT	11
#define MAP_SIZE    (MAP_WIDTH * MAP_HEIGHT)


/*
const int LEFT_TOP			=	0;
const int RIGHT_TOP			=	1;
const int RIGHT				=	2;
const int RIGHT_BOTTOM		=	3;
const int LEFT_BOTTOM		=	4;
const int LEFT				=	5;
const int DIRECTION_COUNT	=	6;
*/
#define LEFT_TOP 0
#define RIGHT_TOP 1
#define RIGHT 2
#define RIGHT_BOTTOM 3
#define LEFT_BOTTOM 4
#define LEFT 5
#define DIRECTION_COUNT 6



int GetX(int x);
int GetY(int y);
int CreatePoint(int x,int y);
/**
 Get the near point of the input parameter [pos],type if the direction of the point
 if the point is not existed,such as outside the map,it returns -1
 */
int	GetNearPoint(int pos,int type);


/**
 get the boundary of a unit can walk,Max_step means the step distance of the unit
 @param:
 Pos_Start:start position
 outputMap:the array used to receive
 */
#import <Foundation/Foundation.h>
void GetCanWalk(int * mapData,int Pos_Start,int * outputMap,int Max_step, int *arrayCanWalk); // Max_step = 0xff
void GetCanWalk2(int * mapData,int Pos_Start,int * outputMap,int Max_step, int *arrayCanWalk); // Max_step = 0xff


/**
 get the boundary of a unit can fly,Max_step means the step distance of the unit
 @param:
 Pos_Start:start position
 */
void GetCanFly(int * mapData,int Pos_Start,int * outputMap,int Max_step, int *arrayCanWalk); // Max_step = 0xFFF
void GetCanFly2(int * mapData,int Pos_Start,int * outputMap,int Max_step, int *arrayCanWalk); // Max_step = 0xFFF

/**
 the array [Path] has been stored the route of the unit after invoking the function
 and it returns how many steps the unit walks,
 [outputMap] must be the return array invoked by GetCanWalk
 and return -1 means startPos or TargetPos is barrier
 */
int GetWalkRoute(int * mapData,int StartPos, int TargetPos,const int * outputMap,NSMutableArray * Path);

int GetFlyRoute(int * mapData,int StartPos, int TargetPos,int * Path);

void PrintOutMap(int * pMap);

//#define MAP_1	
//#define MAP_2	
//#define MAP_3	

